Add the new exampleapp to the docs
authorMatthias Clasen <mclasen@redhat.com>
Sat, 16 Nov 2013 22:03:01 +0000 (17:03 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 16 Nov 2013 22:04:30 +0000 (17:04 -0500)
docs/reference/gtk/Makefile.am
docs/reference/gtk/getting_started.xml
docs/reference/gtk/images/getting-started-app10.png [new file with mode: 0644]
examples/application10/exampleappwin.c

index c1afc06c55f4caf3a9c0a980c69ba607b5a24b9c..848bcd731c225ff1d0a3b53a9f4bed64ec334a91 100644 (file)
@@ -421,6 +421,7 @@ HTML_IMAGES = \
        $(srcdir)/images/getting-started-app7.png                       \
        $(srcdir)/images/getting-started-app8.png                       \
        $(srcdir)/images/getting-started-app9.png                       \
+       $(srcdir)/images/getting-started-app10.png                      \
        $(srcdir)/images/exampleapp.png                                 \
        $(srcdir)/images/flow-box.png
 
index 3ba58e80d737fe667340c575c2b9fb736b15d893..ee86358c04874abe69cfd97dd61acdbdf200f7d7 100644 (file)
@@ -959,7 +959,7 @@ example_app_window_init (ExampleAppWindow *win)
       <ulink url="https://git.gnome.org/browse/gtk+/tree/examples/application9/exampleappwin.c">full source</ulink>
       if you are interested in the details.</para>
 
-      <para>This brings our example application to its final appearance:</para>
+      <para>This brings our example application to this appearance:</para>
 
       <informalfigure>
         <mediaobject>
@@ -969,5 +969,35 @@ example_app_window_init (ExampleAppWindow *win)
         </mediaobject>
       </informalfigure>
     </section>
+    <section>
+      <title>Header bar</title>
+
+      <para>Our application already uses a GtkHeaderBar, but so far it
+      still gets a 'normal' window titlebar on top of that. This is a
+      bit redundant, and we will now tell GTK+ to use the header bar
+      as replacement for the titlebar. To do so, we move it around to
+      be a direct child of the window, and set its type to be titlebar.</para>
+
+      <informalexample>
+        <programlisting><xi:include href="../../../../examples/application10/window.ui" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
+      </informalexample>
+
+      <para>A small extra refinement that we have added here is to allow
+      the header bar to provide a fallback application menu, by setting
+      the show-fallback-app-menu property to TRUE. Here is how the
+      application now looks, if this fallback is used.</para>
+
+      <informalfigure>
+        <mediaobject>
+          <imageobject>
+            <imagedata fileref="getting-started-app10.png" format="PNG"/>
+          </imageobject>
+        </mediaobject>
+      </informalfigure>
+
+      <para>If we set up the window icon for our window, the menu button
+      will use that instead of the generic placeholder icon you see
+      here.
+    </section>
   </section>
 </chapter>
diff --git a/docs/reference/gtk/images/getting-started-app10.png b/docs/reference/gtk/images/getting-started-app10.png
new file mode 100644 (file)
index 0000000..5e11c4c
Binary files /dev/null and b/docs/reference/gtk/images/getting-started-app10.png differ
index 5e7a2784e24090d3a36946e107b7d9d53c11fef2..4c0efc65e021b83fea28c602fa972eb66d63ee17 100644 (file)
@@ -241,7 +241,6 @@ example_app_window_init (ExampleAppWindow *win)
                           priv->lines_label, "visible",
                           G_BINDING_DEFAULT);
 
-  gtk_window_set_icon_name (GTK_WINDOW (win), "sunny");
   g_object_set (gtk_settings_get_default (), "gtk-shell-shows-app-menu", FALSE, NULL);
   gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (win), TRUE);
 }